<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
   <h2>Hello Spring Cloud Alibaba</h2>
   <button onclick="doBuy()">Do Buy</button>
   <span id="result"></span>
   <!--
   <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
   -->
   <script src="/js/axios.min.js"></script>
   <script>
       //客户端调试程序的方式:(debugger,log,排除法)
       function doBuy(){
           debugger
           let url="http://localhost:9000/nacos/provider/echo/ab";
           let spanObj=document.getElementById("result");
           axios.get(url)
               .then(function (response) {
                   //debugger
                   console.log(response);
                   spanObj.innerHTML = response.data;

               })
               .catch(function (error) {
                   //debugger
                   //console.log(error);
                   if(error.response.status==429){
                       spanObj.innerHTML="访问太频繁了";
                   }
               });
       }
   </script>
</body>
</html>